<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>使用v-bind指令-class绑定</title>
<!--引入Vue库-->
<script src="vue.js"></script>
<style>
  .style1 {  
    font-size: 24px;
    font-weight: bold;
	}
  .color1{
    color:blue;
    }	
	.text-danger {
    color: red;
    font-size: 24px;
   }
</style>
</head>
<body>
<div id="app" class="style1"
     v-bind:class="{ color1: isActive, 'text-danger': hasError }">请登录
</div>
<script>
var vm = new Vue({
  el: '#app',
  data:{
       isActive:true,
       hasError:false
  }
})
</script>
</body>
</html>
